<template>
  <div class="article-item">
    <van-cell :title="article.title" size="large"
      :to="'/article/'+article.art_id">
      <!-- <van-cell :title="article.title" size="large"
      :to="{
        name:'article',
        params:{
          articleId:article.art_id
        }
      }"> -->
      <!-- <van-cell :title="article.title" size="large"
      :to="'/article?id='+article.art_id"> -->
      <div slot="label" class="custom-label">
        <div v-if="article.cover.type===3"
          class="cover-images">
          <van-image
            v-for="(item,index) in article.cover.images"
            :key="index" class="right-image"
            fit="cover" :src="item" />
        </div>
        <span>{{article.aut_name}}</span>
        <span
          class="common">{{article.comm_count}}评论</span>
        <span>{{article.pubdate | dateformat}}</span>
      </div>
      <van-image v-if="article.cover.type===1"
        class="right-image" fit="cover"
        :src="article.cover.images[0]" />
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'article-item',
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  data () {
    return {}
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () { },
  mounted () { }
}
</script>

<style scoped lang='less'>
.article-item {
  .van-cell__value {
    flex: unset;
  }
  .right-image {
    width: 232px;
    height: 146px;
  }
  .custom-label {
    font-size: 23px;
    color: #999;
    .cover-images {
      display: flex;
      margin: 30px 0;
      .van-image {
        width: 232px;
        height: 146px;
      }
      .van-image:nth-child(2) {
        margin-left: 4px;
        margin-right: 4px;
      }
    }
    span {
      display: inline-block;
    }
    .common {
      margin-left: 10px;
      margin-right: 10px;
    }
  }
}
</style>
